package qin.entity;

/**
 * 包装bookservice的返回值
 * @author 小行星
 *
 */
public class R <T> {
	private boolean status;
	private String msg;
	private T data; 
	
	public R() {};
	
	public R(boolean status, String msg, T data) {
		this.status = status;
		this.msg = msg;
		this.data = data;
	}
	
	public static <T> R<T> ok(String msg, T data) {
		return new R<T>(true, msg, data);
	}
	
	public static <T> R<T>  no(String msg, T data) {
		return new R<T>(false, msg, data);
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return "R [status=" + status + ", msg=" + msg + ", data=" + data + "]";
	}
	
	
}
